package com.lanchetech.dao;

import com.lanchetech.entity.AdminPermission;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface AdminPermissionMapper {
    int deleteByPrimaryKey(Long id);

    int insert(AdminPermission record);

    int insertSelective(AdminPermission record);

    AdminPermission selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(AdminPermission record);

    int updateByPrimaryKey(AdminPermission record);

    @Select("select p.id, p.catalog, p.name, p.permission from admin_role_permission a left join admin_permission p on p.id = a.permission_id where role_id = #{roleId}")
    List<AdminPermission> getAdminPermissionList(Long roleId);

    List<AdminPermission> findAll();


}